<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/xadmin/css/font.css">
    <script type="text/javascript" src="/static/xadmin/js/xadmin.js"></script>
    <title>添加商品按钮</title>
</head>
<body>
<div class="layui-container">
    <button class="layui-btn" onclick="xadmin.open('添加商品','/admin/store.PinkConfig/goodsAdd')"><i
            class="layui-icon"></i>添加
    </button>
</div>
</body>
</html>
<script src="/static/xadmin/lib/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('element', function () {
        var $ = layui.jquery
            , element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        //触发事件
        var active = {
            setPercent: function () {
                //设置50%进度
                element.progress('demo', '50%')
            }
            , loading: function (othis) {
                var DISABLED = 'layui-btn-disabled';
                if (othis.hasClass(DISABLED)) return;

                //模拟loading
                var n = 0, timer = setInterval(function () {
                    n = n + Math.random() * 10 | 0;
                    if (n > 100) {
                        n = 100;
                        clearInterval(timer);
                        othis.removeClass(DISABLED);
                    }
                    element.progress('demo', n + '%');
                }, 300 + Math.random() * 1000);
                othis.addClass(DISABLED);
            }
        };
    });
</script>